package net.seabookchen.pojo;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name="moodType")
public enum MoodType {
	HAPPY("/images/happy.png"), 
	GOOD("/images/good.png"), 
	SOSO("/images/soso.png"), 
	SAD("/images/sad.png"), 
	ANGRY("/images/angry.png");
	
	private String renderImgUrl;
	
	private MoodType(String renderImgUrl) {
		this.renderImgUrl = renderImgUrl;
	}
	
	
	public static MoodType getMoodType(String moodType) {
		MoodType type = HAPPY;
		if (moodType == null || "".equals(moodType)) {
			return type;
		}
		
		MoodType[] types = MoodType.values();
		for (MoodType mtype : types) {
			if (mtype.toString().toLowerCase().equals(moodType.toLowerCase())) {
				type = mtype;
				break;
			}
		}
		return type;
	}


	public String getRenderImgUrl() {
		return renderImgUrl;
	}

	public void setRenderImgUrl(String renderImgUrl) {
		this.renderImgUrl = renderImgUrl;
	}
	
}

